﻿using System.Collections.ObjectModel;

namespace Phylogeny.Dendogram
{
    public class DendoNodes<T> : ObservableCollection<DendoNode<T>>
    {

        public DendoNodes()
        {
           
        }

        //protected override void OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        //{
        //    if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
        //    {
        //        foreach (INotifyPropertyChanged item in e.NewItems)
        //        {
        //            item.PropertyChanged += new PropertyChangedEventHandler(item_PropertyChanged);
        //        }
        //    } if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove)
        //    {
        //        foreach (INotifyPropertyChanged item in e.OldItems)
        //        {
        //            item.PropertyChanged -= new PropertyChangedEventHandler(item_PropertyChanged);
        //        }
        //    }
        //    base.OnCollectionChanged(e);
            
        //}

        //private DendoNode<T> _selected;
        //private int callcount = 0;
        //void item_PropertyChanged(object sender, PropertyChangedEventArgs e)
        //{
        //    callcount++;
        //    DendoNode<T> s = sender as DendoNode<T>;
        //    if (e.PropertyName == "IsSelected" && s.IsSelected)
        //    {
        //        if (_selected != null)
        //            _selected.IsSelected = false;
        //        _selected = s;
        //    }
        //}

        //protected override void OnPropertyChanged(System.ComponentModel.PropertyChangedEventArgs e)
        //{
        //    base.OnPropertyChanged(e);
           
        //}

    }
}
